home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / bbs / mxgui203.zip / MAXDOOR.DOC < prev    next >
Text File  |  1997-08-14  |  36KB  |  670 lines

  1.  ╔═══════════════════════════════════════════════════════════════════════════╗
  2.  ║     FIRST THINGS FIRST - READ THE FILE WARNING.TXT BEFORE PROCEEDING!     ║
  3.  ╚═══════════════════════════════════════════════════════════════════════════╝
  4.  
  5.                              ┌╦══╦┐ ┌╦══╦┐ ┌╦═══╦┐
  6.                              │╠══╩╗┐│╠══╩╗┐└╩═══╦┐
  7.                              └╩═══╩┘└╩═══╩┘└╩═══╩┘
  8.         ┌╦   ╦┐┌═╤╦╤═┐┌═╤╦╤═┐┌╔     ┌═╤╦╤═┐┌═╤╦╤═┐┌╔═══╦┐┌╔═══╦┐┌════╦┐
  9.         │║   ║│  │║│    │║│  │║       │║│    │║│  │╬══   │╬══   ┌─╔═╝─┘
  10.         └╩═══╩┘  ╧╩╧  └═╧╩╧═┘└╩═══╩┘└═╧╩╧═┘  ╧╩╧  └╩═══╩┘└╩═══╩┘└╚════┘
  11.             ┌╦═══╦┐┌╦═══╦┐┌╔═══╦┐┌═╤╦╤═┐┌╦   ╦┐┌╦═══╦┐┌╦═══╦┐┌╔═══╦┐
  12.             └╩═══╦┐│║   ║││╬══     │║│  │║ ╦ ║│├╬═══╬┤│╠══╦╩┘│╬══
  13.             └╩═══╩┘└╩═══╩┘└╩       ╧╩╧  └╩═╩═╩┘└╩   ╩┘└╩  ╚═┘└╩═══╩┘ <tm>
  14.  
  15.                             A Subsidary Of LA-Soft
  16.  
  17. ───────────────────────────────────────────────────────────────────────────────
  18.    ▀▀▀▀▀▀▀▀  ▀▀▀▀▀▀    ▀▀   ▀▀
  19.      ▀▀     ▀▀   ▀▀   ▀▀  ▀▀
  20.     ▀▀     ▀▀   ▀▀▀  ▀▀▀▀▀  The DoorKit!
  21.    ▀▀     ▀▀   ▀▀   ▀▀  ▀▀
  22.   ▀▀     ▀▀▀▀▀▀    ▀▀    ▀▀
  23.   The BBS Door Development Kit By The People - For The People!
  24. ───────────────────────────────────────────────────────────────────────────────
  25.   The ANSI/ASCII/RIP/MAX DoorKit v1.36
  26.   No Copyright Notices Expressed Or Implied
  27.   Compiled By Larry L. Athey From Numerous Sources
  28. ───────────────────────────────────────────────────────────────────────────────
  29.   ▀▀▀   ▀▀▀   ▀▀▀▀▀   ▀▀   ▀▀
  30.   ▀▀▀▀ ▀▀▀▀  ▀▀   ▀▀   ▀▀ ▀▀
  31.   ▀▀ ▀▀▀ ▀▀  ▀▀▀▀▀▀▀    ▀▀▀    ╔══ ╦═╗ ╔═╗ ╦═╗ ╦ ╦ ╦ ╔═╗ ╔═╗
  32.   ▀▀  ▀  ▀▀  ▀▀   ▀▀   ▀▀ ▀▀   ║ ╦ ╠╦╝ ╠═╣ ╠═╝ ╠═╣ ║ ║   ╚═╗
  33.   ▀▀     ▀▀  ▀▀   ▀▀  ▀▀   ▀▀  ╚═╝ ╩╚═ ╩ ╩ ╩   ╩ ╩ ╩ ╚═╝ ╚═╝
  34. ───────────────────────────────────────────────────────────────────────────────
  35.   The Universal Multimedia Interface For BBS Software
  36.   Copyright 1995-Current * Larry L. Athey * BBS Utiliteez Software
  37. ───────────────────────────────────────────────────────────────────────────────
  38.  
  39.   Information Regarding MAX Graphics:
  40.   ───────────────────────────────────
  41.   Notice is hereby given that the MAXscript/MAXcontrol/MAXcolor language,
  42.   and MAXterm are products of BBS Utiliteez Software and are protected by
  43.   US copyrights listed with the US Library Of Congress (1996)....
  44.  
  45.   No changes, additions, subtractions, or other modifications shall be made
  46.   to MAXscript/MAXcontrol/MAXcolor language or the MAX Graphics development
  47.   kit without express written permission from Larry L. Athey, BBS Utiliteez
  48.   Software, Alliance, Nebraska, USA....
  49.  
  50.   The MAXscript/MAXcontrol/MAXcolor language may be used in any BBS or Door
  51.   software 100% royalty free. You are also allowed to implement full local
  52.   graphics viewing in any BBS or Door software 100% royalty free. However,
  53.   any program that uses the MAXscript/MAXcontrol/MAXcolor language *MUST*
  54.   bear the MAX Graphics/BBS Utiliteez Software copyright notice....
  55.  
  56.   Example: MAX Graphics and the MAXscript/MAXcontrol/MAXcolor language is
  57.              (C) 1995-Current * Larry L. Athey * BBS Utiliteez Software
  58.  
  59.   Disclaimer:
  60.   ───────────
  61.   MAX Graphics, MAXscript/MAXcontrol/MAXcolor and MAXterm are by no means
  62.   copies of, or otherwise plagiarized remote graphics methods used by any
  63.   other BBS software. Even though MAXterm responds to a few commands used
  64.   by RIPscrip and other RIP capable BBSes, this is by no means any kind of
  65.   a copyright infringement of the RIP technology. If it was, then I'm sure
  66.   that Pat Clawson of TeleGrafix would have notified me by now....
  67.  
  68.   Yes, there are some similarities between MAX Graphics and some other BBS
  69.   graphical user interfaces, yet this is still not any kind of a copyright
  70.   infringement either. Since I have ran about every graphical BBS out there
  71.   from DOS to Windows platforms, I'm bound to create things in the image of
  72.   my own memory. Even the authors of other graphical BBS packages have told
  73.   me where they got their ideas....Other graphical BBS packages....So don't
  74.   worry if someone tells you "Gee, your BBS looks a lot like Shotgun BBS or
  75.   RoboBOARD/FX", all similarities if any are 100% within copyright laws....
  76.  
  77.   ....End of disclaimer....
  78.  
  79. ───────────────────────────────────────────────────────────────────────────────
  80.  
  81.   The Contributors:
  82.   ─────────────────
  83.   This is a list of people who contributed to the cause of beta testing the
  84.   MAX Graphics related programs and the TDK door development kit.  Although
  85.   there were more people who applied to be beta testers, most of these beta
  86.   sites never posted anything in the support echo, so I don't consider them
  87.   to have made any contribution to the cause. But, these people stood by me
  88.   and my efforts without a single sour word, and never threw in the towel..
  89.  
  90.   Many people apply to be a beta tester for new programs and never think of
  91.   the qwerks involved in testing untested software. So they quickly give up
  92.   and avoid beta testing like the plague. Beta testing requires a person to
  93.   do nearly as much work (if not actually more) as the programmer themself.
  94.  
  95.   Programs can't evolve without testers actually running the program and at
  96.   least trying to make it work even with the bugs in it.  True beta testers
  97.   don't seem to know the meaning of the phrase "I give up", and that's what
  98.   makes being a program author worth while. I couldn't give a damn if I get
  99.   one more program registration in my life,  so long as there are dedicated
  100.   common sense thinking people like this standing by you, it's worth while!
  101.  
  102.         Let's here it for the people that refused to say "I give up"!
  103.  
  104.   Name:                          BBS:                            Phone:
  105.   ───────────────────────────────────────────────────────────────────────────
  106.   Brad Larned (1:205/400)        The Fresno Online BBS           209-276-3657
  107.   Sean Price (1:205/46)          Sanctuary From The Law BBS      619-377-3611
  108.   Chris Martin (1:219/308)       The Mars Station BBS            760-254-3012
  109.   Bob Wingender (1:284/11)       The Oak Tree BBS                417-581-0868
  110.   Chet Rhodes (1:151/124)        Hawkmoon's Realm                919-556-8363
  111.   Larry Thrasher (1:3612/650)    The Night Thrasher BBS          904-937-9144
  112.   Thomas Wells (1:3621/1)        Renegade's Hideout              615-326-5597
  113.   Timothy Barney (1:2622/3)      The Gravel Pit                  814-942-1552
  114.   Cliff Williams (1:112/124)     The City Of Thought             904-645-8850
  115.   Jon Parise (1:2606/421)        Infinite Twilight               908-637-8243
  116.   Arthur Stark (1:395/670)       Top's Diamond Mine              254-542-8783
  117.   Ronald Schlegel (1:110/1065)   Dynasty BBS                     937-258-1030
  118.   David Raasch (1:280/285)       Let It Shine Online!            816-461-2290
  119.   ───────────────────────────────────────────────────────────────────────────
  120.  
  121.   NOTE: These names appear in no particular order, they are only listed here
  122.         as the names appear in my MAX Graphics area message base...
  123.  
  124. ───────────────────────────────────────────────────────────────────────────────
  125.  
  126.   The Golden Rule Of Writing TDK MAX Doors:
  127.   ─────────────────────────────────────────
  128.   First of all, before you even attempt to write a TDK MAX door, or a MAX door
  129.   with any other door development kit, read MAXINFO.DOC in its entirety so you
  130.   understand exactly how MAX Graphics works. Don't be scared of this rule, you
  131.   will see that using the MAX language is almost identical to using Pascal, so
  132.   you will definitely be able to grasp this concept with no problems at all...
  133.  
  134.   It is imperative that you fully understand how MAX Graphics and MAXterm work
  135.   with each other before you attempt to write a MAX door...If you just jump in
  136.   to this thing head first without looking ahead of time, chances are that you
  137.   will end up injuring your head. Most likely from banging your head against a
  138.   wall trying to figure out why something isn't working like you want it to...
  139.  
  140.   MAX Graphics is totally unlike RIP...You can actually learn MAX and memorize
  141.   it just like a programming language...The most important thing about writing
  142.   a MAX door is to not allow yourself to be initimidated, you are only writing
  143.   a program to send text to the remote. All of the low level stuff is actually
  144.   handled by MAXterm...So don't be scared, and don't make things hard, because
  145.   you now have a way of making SVGA doors just as simple as if you were making
  146.   a plain old ANSI/ASCII door...
  147.  
  148. ───────────────────────────────────────────────────────────────────────────────
  149.  
  150.   About The MAXDOOR Archive:
  151.   ──────────────────────────
  152.   This archive contains sample source code to show the principals of writing
  153.   MAX compatible doors. This document is not a replacement for MAXINFO.DOC,
  154.   so be sure you read that sucker over and over until you have bad dreams of
  155.   little MAX commands attacking you in your sleep...  :)  What follows here
  156.   are special considerations to keep in mind about the concepts used in the
  157.   MAXDOOR.PAS sample program, in the order they appear in that program...
  158.  
  159. ───────────────────────────────────────────────────────────────────────────────
  160.  
  161.   Displaying MAX Screen Files With TDK:
  162.   ─────────────────────────────────────
  163.   Regarding DOORKIT3.PAS / PROCEDURE ShowScreen(Scr : STRING);
  164.  
  165.   You don't have to do anything special in your doors to display screen files
  166.   with TDK. MAX screen files don't even need to have the ASCII #12 in them to
  167.   clear the remote screen because TDK automatically sends it if it detects a
  168.   user is running MAXterm. If TDK detects MAXterm, all MAX screen commands are
  169.   sent directly to the comport rather than being scrolled up the screen. When
  170.   MAXterm is detected, a simple banner is printed at the bottom of the screen
  171.   telling you that it is displaying the screen file to the remote. This looks
  172.   better than having a bunch of garbage commands rolling about the screen. TDK
  173.   also does the same thing in the event of RIP and AVATAR callers as well...
  174.  
  175.   If you want to have more than one MAX window on the screen at once, you can
  176.   tell TDK not to send the ASCII #12 to kill the screen. There is a variable
  177.   in TDK called "NoKill". If you make a call to "NoKill := TRUE;" before you
  178.   display a MAX screen file, and so long as your screen file itself does not
  179.   contain an ASCII #12 or Start_Screen() command at the beginning, the screen
  180.   file contents will overlap the previous screen. In this case, you will want
  181.   to make sure that your screen starts with a Hide_Mouse() command, and that
  182.   you insert a Show_Mouse() command before the End_Screen() command...
  183.  
  184. ───────────────────────────────────────────────────────────────────────────────
  185.  
  186.   Displaying Text Files With TDK:
  187.   ───────────────────────────────
  188.   Regarding DOORKIT3.PAS / PROCEDURE ShowTextFile(TextFile : STRING);
  189.  
  190.   Displaying a text file to a MAXterm user can be done in two ways, you can
  191.   either use the built in text file reader in MAXterm, so long as your text
  192.   file contains no more than 800 lines. Or, you can use the procedure in TDK
  193.   to display a text file of unlimited size. The main advantage to using the
  194.   text file displaying procedure in TDK is that unlike the text file viewer
  195.   in MAXterm, the text file doesn't need to first exist on the user's system
  196.   in the ?:\MAXTERM\SESSION\ subdirectory...
  197.  
  198.   The ShowTextFile procedure in DOORKIT3.PAS simplifies displaying text files
  199.   to the remote caller no matter what terminal emulation they support. In MAX
  200.   Graphics mode, this procedure sends a list of commands to draw a text file
  201.   reader on the screen with buttons at the bottom for scrolling through the
  202.   file. All Hide_Mouse() and Show_Mouse() procedures are handled automatically
  203.   All you do is tell the procedure the path and file name of the text file and
  204.   that's it.
  205.  
  206.   You may still use MAXterm's internal text file viewer with a TDK MAX door if
  207.   you wish. However, you will have to write the commands into your program to
  208.   read the text file and send it using the Start_Text_File, Put_Text_File, and
  209.   End_Text_File MAX commands. It's up to you how you want to do things, I just
  210.   added the ShowTextFile procedure in TDK to simplify things for you...
  211.  
  212. ───────────────────────────────────────────────────────────────────────────────
  213.  
  214.   Sending Actual MAX Commands To The Caller:
  215.   ──────────────────────────────────────────
  216.   Regarding MAX_UNIT.PAS / PROCEDURE MaxCommand(S : STRING);
  217.  
  218.   This procedure is included in TDK to help automate and simplify the sending
  219.   of MAX commands, and handle any return data that certain MAX commands make
  220.   MAXterm return to your program. As you know from reading MAXINFO.DOC, there
  221.   are some MAX commands that make MAXterm kick back data to your program, so
  222.   you need a way of handling this data. What would be great is if there was a
  223.   way to handle this data in a simple kindergarten level manner. Well, that's
  224.   what this procedure does. Any time MAXterm kicks back any data like that,
  225.   the MaxCommand procedure will write this data to text files in the current
  226.   program directory. All text files use file names that are node specific so
  227.   as to prevent interference with the same program running on other nodes...
  228.  
  229.   You may send MAXscript, MAXcontrol, and MAXcolor commands with MaxCommand,
  230.   all commands are sent with a carriage return & line feed combination at the
  231.   and, so you don't have to worry about adding a #13#10 at the end of them...
  232.  
  233.   What follows below are various examples of how the MaxCommand procedure is
  234.   used in a TDK MAX door, and how any return data is handled and stored...
  235.  
  236. ───────────────────────────────────────────────────────────────────────────────
  237.  
  238.   Special Considerations Regarding MAX Entry Fields:
  239.   ──────────────────────────────────────────────────
  240.   When writing MAX doors, there are some things you need to keep in mind about
  241.   the way MAXterm works. One thing you will probably think is ass backwards is
  242.   that ALT keypresses in MAXterm actually work over the modem. Well, I should
  243.   say that they "Partially" work, MAXterm doesn't send the initial ASCII #0 or
  244.   NUL character, it only sends the secondary extended scan code. This is done
  245.   this way because there are certain internal features in MAXterm that use ALT
  246.   keypresses and normal keypresses at the same time...
  247.  
  248.   Take the entry fields for example. Users type things as normal in an entry
  249.   field, and if there are more than one entry field on the screen, the <TAB>,
  250.   <ENTER> and arrow keys scroll through the fields. Well, you need a way to
  251.   get out of the entry fields and tell the door that you are out of them...So,
  252.   this is why the ALT keypresses actually work over the modem. Unlike straight
  253.   ANSI/ASCII doors written with TDK, when you use entry fields with MAXterm,
  254.   all the work is actually done within MAXterm itself. Things are done in this
  255.   way because it eliminates the need to keep a constant flow of ANSI escape
  256.   sequences running back and forth, thus resulting in a faster and smoother
  257.   operation for both programs at the same time...
  258.  
  259.   In the example MAXDOOR.PAS program, you will see that the entry field demo
  260.   looks for an ASCII #24 to tell the door to query MAXterm for the text that
  261.   the user typed in the entry fields. The FDEMO.MAX screen has two buttons in
  262.   it, one assigned to an ALT-O (ASCII #24) for "Okay", and the other assigned
  263.   to ALT-Q (ASCII #16) for "Quit"...Both buttons are assigned to and ALT key
  264.   so the user can escape the loop in MAXterm that runs the entry fields, and
  265.   the ordinal value assigned to each button is sent back to your door so you
  266.   can trap it in the program and handle the required procedures...
  267.  
  268.   Querying MAXterm For Entry Field Data:
  269.   ──────────────────────────────────────
  270.   In the example MAXDOOR.PAS program, you will see that the entry field demo
  271.   uses the MaxCommand procedure to force MAXterm to kick back the contents of
  272.   all the entry fields in the current window. As you know by reading the file
  273.   MAXINFO.DOC, every MAX command has two versions. One MAXscript command that
  274.   is humanly readable, and the MAXcontrol counterpart that really isn't that
  275.   readable. I prefer to use MAXcontrol for everything because it's faster and
  276.   I seldomly ever have to read through my screen files. If I do, then I just
  277.   load up the screen in MAXpaint and read it that way...
  278.  
  279.   In the example program I use the Get_Field_Data command to tell MAXterm that
  280.   I need the text from all of the current entry fields to be sent back to me.
  281.   When you make a call to the procedure MaxCommand('Get_Field_Data()'); or
  282.   MaxCommand(#255#126#250#255); special procedures are automatically taken care
  283.   of for you by the MAX_UNIT.PAS unit to obtain the entry field text...
  284.  
  285.   The text from each entry field in MAXterm will be written to a file on your
  286.   hard drive. The file name is FIELDS.### where the ### represents the current
  287.   node number (ie: FIELDS.1 through FIELDS.255). The text is written to this
  288.   file in the same order that the entry fields are plotted on the screen in
  289.   MAXterm. After you send the Get_Field_Data command, simply look for the text
  290.   file on the hard drive in the current directory. If the file exists, then
  291.   the transfer of field data was successful, and you can now read the data out
  292.   of the text file, then apply it to your door as needed...
  293.  
  294. ───────────────────────────────────────────────────────────────────────────────
  295.  
  296.   Special Considerations Regarding MAX PickLists:
  297.   ───────────────────────────────────────────────
  298.   As you probably know, the little "ANSI LightBar Menu" feature in some BBSes
  299.   is just the coolest thing in the world to some sysops. I find it boring and
  300.   a waste of time because a single keypress accesses a menu function faster..
  301.   But, for those people that like the LightBar effect, there is a feature in
  302.   MAX Graphics to allow something similar. This is called a "PickList" in MAX
  303.   Graphics and they work similar to the scrolling selection menus in Windows
  304.   or OS/2. You can have a little box on the screen that only shows ten items
  305.   in it at once, but it can actually have up to 800 items to choose from. The
  306.   items scroll through the little box with a highlight bar which is used for
  307.   selecting an item in the picklist. You can use your mouse to select/scroll
  308.   the items, your arrow keys, your Page-Up/Page-Down keys, or a combination
  309.   of CTRL-Page-Up/CTRL-Page-Down to jump to the top or bottom of the picklist.
  310.  
  311.   PickLists must be initialized, stuffed, and activated in exactly that order.
  312.   An example of this would be:
  313.  
  314.   New_PickList(100,100,3,30)   {PickList Initialization}
  315.   AddTo_PickList('Item #1')    {PickList Stuffing}
  316.   AddTo_PickList('Item #2')    {"               "}
  317.   AddTo_PickList('Item #3')    {"               "}
  318.   AddTo_PickList('Item #4')    {"               "}
  319.   AddTo_PickList('Item #5')    {"               "}
  320.   SetUp_PickList()             {PickList Activation}
  321.  
  322.   This sequence of MAX commands (excluding the {Comments}) initializes a new
  323.   picklist on the screen at the coordinates 100/100. The picklist only allows
  324.   3 items to to appear on the screen at any one time, and the picklist allows
  325.   up to 30 characters of each item to display on the screen. Now, even though
  326.   only 3 items are displayed at any one time, the picklist actually contains
  327.   5 items that will scroll through the picklist field on the screen...
  328.  
  329.   It is critical that you execute these commands in the order that they appear
  330.   in the above example, the reason for this is fully detailed in MAXINFO.DOC..
  331.   You may have up to 800 AddTo_PickList(' ') commands in the screen file, so a
  332.   picklist can really be HUGE, but only have a small fraction of items on the
  333.   screen...
  334.  
  335.   The SetUp_PickList() command is what actually draws out the picklist items
  336.   on the screen. Let's say that you wanted the picklist to default to another
  337.   item besides number 1 when it is activated. You can do this by a call to the
  338.   Reset_PickList() command before the SetUp_PickList() command. Say that your
  339.   picklist has 500 items in it, and you want it to always default to item 250
  340.   when it draws. Simply insert a Reset_PickList(250) before SetUp_PickList...
  341.  
  342.   The most important thing to keep in mind about picklists is that they MUST
  343.   appear in the screen before any other buttons. This is because the buttons
  344.   in the picklist are automatically assigned to buttons number 1 and 2. This
  345.   is something you will never have to worry about if you make your screens in
  346.   MAXpaint, because it has built in intelligent MAX syntax checking. However,
  347.   if you are manually writing your screens just as if you were using graphics
  348.   commands in a programming language, you have to make sure that you get the
  349.   commands in the screen in the correct place, and in the correct order...
  350.  
  351.   Detecting The Selected PickList Item:
  352.   ─────────────────────────────────────
  353.   Now that you know how to properly place a picklist on the screen, how does a
  354.   person tell when the user selects an item, and which item is selected? This
  355.   is just as simple as obtaining the field data mentioned in the above. If you
  356.   look at the picklist example code in MAXDOOR.PAS, you'll see that things are
  357.   done the same way. Meaning, you check for ALT keypresses and tell MAXterm to
  358.   send data back that is written to a text file on your hard drive...
  359.  
  360.   In the example code, the screen file containing the picklist uses an ALT-S
  361.   keypress assigned to a button labeled "Select" in the screen file. When the
  362.   button is clicked, or when the user presses ALT-S, MAXterm will return an
  363.   ASCII #31 to your door. If you receive an ASCII #31, then you know that you
  364.   need to use the MaxCommand procedure to tell MAXterm to report which item
  365.   in the picklist has the highlight bar on it. Again, there are two different
  366.   commands that will tell MAXterm to send back this information:
  367.  
  368.   MaxCommand('Get_Pick_Info()');  { MAXscript  Get_Pick_Info }
  369.   MaxCommand(#255#126#247#255);   { MAXcontrol Get_Pick_Info }
  370.  
  371.   When MAXterm sends the information back, you will end up with a file on the
  372.   hard drive in the current directory. The file name is PICKINFO.### where the
  373.   ### represents the current node number (ie: PICKINFO.1 thru PICKINFO.255)...
  374.   In this text file, there will be two lines of text. The first line will show
  375.   the actual number of the selected picklist item, and the second line will be
  376.   the actual text string of the selected picklist item. Once you have the file
  377.   on your hard drive, you just read the file and apply the data to your door
  378.   as needed...
  379.  
  380. ───────────────────────────────────────────────────────────────────────────────
  381.  
  382.   Using MAXterm Text View Ports:
  383.   ──────────────────────────────
  384.   The use of Text View Ports in your doors can help you cut down your program
  385.   overhead in a major way because it allows you to share the same text output
  386.   routines that your door's ANSI side uses in the door's MAX side as well...
  387.  
  388.   If you look at the Text View Port Example in MAXDOOR.PAS, you will see that
  389.   it uses the OutTxt procedure to print the text just like you would use in an
  390.   ANSI/ASCII door. Another thing is that even though there is active graphics
  391.   on the screen (meaning anything changing after the window is drawn) text in
  392.   the port will not cause "Mouse Warts" on the screen if the mouse happens to
  393.   be within the port while the text is drawing. This is all handled within the
  394.   terminal program, so there is no need to send a bunch of mouse hide and show
  395.   commands to the remote...
  396.  
  397.   Also, as a review note...Text View Ports can be up to 79 columns wide, and
  398.   up to 25 rows high. You can essentially draw a full size ANSI screen within
  399.   a Text View Port if you wish to...
  400.  
  401. ───────────────────────────────────────────────────────────────────────────────
  402.  
  403.   Internal Screen Files:
  404.   ──────────────────────
  405.   If you don't want to have a bunch of separate screen files lying around the
  406.   hard drive, you can easily put your screen files right into your program...
  407.   The MAXTOPAS.EXE utility will read a MAX screen file and create an include
  408.   file that you can link into your program. The screen file will be converted
  409.   to an individual procedure. If your screen file is MAINMENU.MAX, the utility
  410.   will read the file and create a procedure called Mainmenu_Max in a separate
  411.   include file (MAXTOPAS.INC)...Simply add a {$I MAXTOPAS.INC} in your program
  412.   and call the procedures as needed. Every time you run MAXTOPAS.EXE, it will
  413.   look for the MAXTOPAS.INC file. If it doesn't exist, it will be created, if
  414.   it does exist, all screens will be appended to the end of the file...
  415.  
  416.   You will most likely want to overlay the unit that calls these procedures
  417.   because it will end up taking a big hunk out of the conventional memory if
  418.   you have a lot of internal screen files. If you overlay them, then they will
  419.   be held in XMS, EMS, or in the overlay on the disk. All of this is handled
  420.   automatically by the OVERXMS.PAS unit. Be sure to keep backup copies of your
  421.   screen files in the event you want to change them in the future. Also, you
  422.   will have to save your screen files with the ASCII #12 in them before they
  423.   are converted if you don't want screens to constantly overlap each other...
  424.  
  425.   See the file MAXDOOR.INC and how the file is linked into MAXDOOR.PAS for a
  426.   clearer idea of how all of this works...
  427.  
  428.   HEY - THIS IS IMPORTANT!
  429.   ────────────────────────
  430.   You don't have to include full icon libraries with your doors. If your door
  431.   only uses two or three icons, you can chop the library down so there are
  432.   only the required icons for your door included in the library. Doing this
  433.   also protects your icons from being modified because neither MAXpaint, or
  434.   the icon editor in the MAXterm Plug-Ins will load an icon library unless it
  435.   has 100 icon records in it...
  436.  
  437.   Below is a basic example of how you can chop any icon library down to size
  438.   for use with your door. When a door displays an icon, all you do is seek to
  439.   a specific record location, so just put all of your icons at the beginning
  440.   of the icon library and never try to seek past the highest record number.
  441.   It also makes for a much faster transfer of your icons in resource updates.
  442.  
  443.  
  444. {$A+,B-,D+,E+,F+,G+,I-,L+,N-,O+,P-,Q-,R-,S-,T-,V+,X+}
  445. PROGRAM ICONCHOP; {This code is courtesy of Brad Larned / FzSoft}
  446.  
  447. USES CRT,DOS;
  448.  
  449. TYPE Icon16x16 = RECORD
  450.      Matrix    : ARRAY[1..16,1..16] OF BYTE;
  451.      END;
  452. TYPE Icon30x30 = RECORD
  453.      Matrix    : ARRAY[1..30,1..30] OF BYTE;
  454.      END;
  455. TYPE Icon60x60 = RECORD
  456.      Matrix    : ARRAY[1..60,1..60] OF BYTE;
  457.      END;
  458.  
  459. VAR
  460.   I16    : Icon16x16;
  461.   Dat16  : FILE OF Icon16x16;
  462.   D16    : FILE OF Icon16x16;
  463.  
  464.   I30    : Icon30x30;
  465.   D30    : FILE OF Icon30x30;
  466.   Dat30  : FILE OF Icon30x30;
  467.  
  468.   I60    : Icon60x60;
  469.   D60    : FILE OF Icon60x60;
  470.   Dat60  : FILE OF Icon60x60;
  471.  
  472.   FName1 : STRING;
  473.   FName2 : STRING;
  474.   Stop   : BYTE;
  475.   Count  : BYTE;
  476.  
  477. {───────────────────────────────────────────────────────────────────────────}
  478. FUNCTION StrToInt(S : STRING) : LONGINT;
  479. VAR
  480.   L : LONGINT;
  481.   U : INTEGER;
  482. BEGIN
  483.   VAL(S,L,U);
  484.   StrToInt := L;
  485. END;
  486. {───────────────────────────────────────────────────────────────────────────}
  487. FUNCTION Exist(Filename : STRING) : BOOLEAN;
  488. VAR
  489.   Inf : SEARCHREC;
  490. BEGIN
  491.   FINDFIRST(Filename,AnyFile,Inf);
  492.   Exist := (DOSERROR = 0);
  493. END;
  494. {───────────────────────────────────────────────────────────────────────────}
  495.  
  496. { ICONCHOP.EXE OldFile Newfile Count      }
  497. { Paramstr(1) = Current Icon Library Name }
  498. { Paramstr(2) = New Icon Library Name     }
  499. { Paramstr(3) = New Icon Count - Cut here }
  500.  
  501. BEGIN
  502.   IF PARAMCOUNT = 3 THEN BEGIN
  503.     FName1 := PARAMSTR(1);
  504.     FName2 := PARAMSTR(2);
  505.     Stop   := StrToInt(PARAMSTR(3));
  506.     IF (Stop = 0) OR (Stop > 100) OR (NOT Exist(FName1)) OR (FName1 = FName2) THEN HALT;
  507.     Count := 1;
  508.     IF POS('.001',FName1) > 0 THEN BEGIN            { 16 x 16 Icon Sets }
  509.       WRITELN('16 x 16 Icon Library Detected...');
  510.       ASSIGN(Dat16,FName1);
  511.       ASSIGN(D16,FName2);
  512.       RESET(Dat16);
  513.       REWRITE(D16);
  514.       WHILE (NOT EOF(Dat16)) AND (Count <= Stop) DO BEGIN
  515.         INC(Count);
  516.         READ(Dat16,I16);
  517.         WRITE(D16,I16);
  518.       END;
  519.       CLOSE(D16);
  520.       CLOSE(Dat16);
  521.     END ELSE IF POS('.002',FName1) > 0 THEN BEGIN   { 30 x 30 Icon Sets }
  522.       WRITELN('30 x 30 Icon Library Detected...');
  523.       ASSIGN(Dat30,FName1);
  524.       ASSIGN(D30,FName2);
  525.       RESET(Dat30);
  526.       REWRITE(D30);
  527.       WHILE (NOT EOF(Dat30)) AND (Count <= Stop) DO BEGIN
  528.         INC(Count);
  529.         READ(Dat30,I30);
  530.         WRITE(D30,I30);
  531.       END;
  532.       CLOSE(D30);
  533.       CLOSE(Dat30);
  534.     END ELSE IF POS('.003',FName1) > 0 THEN BEGIN   { 60 x 60 Icon Sets }
  535.       WRITELN('60 x 60 Icon Library Detected...');
  536.       ASSIGN(Dat60,FName1);
  537.       ASSIGN(D60,FName2);
  538.       RESET(Dat60);
  539.       REWRITE(D60);
  540.       WHILE (NOT EOF(Dat60)) AND (Count <= Stop) DO BEGIN
  541.         INC(Count);
  542.         READ(Dat60,I60);
  543.         WRITE(D60,I60);
  544.       END;
  545.       CLOSE(D60);
  546.       CLOSE(Dat60);
  547.     END;
  548.     WRITELN;
  549.     WRITELN('All Done, New Icon Library ',FName2,' length set at (',Stop,') Icons ..');
  550.     WRITELN;
  551.   END ELSE WRITELN('ICONCHOP.EXE OldFile Newfile Count');
  552. END.
  553.  
  554. ───────────────────────────────────────────────────────────────────────────────
  555.  
  556.   Implementing MAXecutables:
  557.   ──────────────────────────
  558.   MAXterm is also capable of a very special feature which allows you to write
  559.   doors that also run on the user's system. These are referred to as (what I
  560.   call) a MAXecutable file. These are special executables that run in MAXterm's
  561.   \SESSION\ subdirectory. These executables are called with MAXterm's program
  562.   home directory as the only command line parameter. MAXecutables must also
  563.   read the \MAXTERM\SESSION\MAXINFO.DEF drop file, this is a custom drop file
  564.   that is created every time MAXterm receives the MAXecute() script command.
  565.  
  566.   Here is how MAXecutables work with MAXterm:
  567.  
  568.   1. A MAXecutable is a standard executable file with the exception that it has
  569.      to be run in the \SESSION\ subdirectory of MAXterm. You can still run them
  570.      locally by feeding them false information in their start up files, this is
  571.      needed for development. A MAXecutable is designed to read a MAXINFO.DEF
  572.      drop file to get all of the required communications parameters, user name,
  573.      etc.
  574.  
  575.   2. When you send the MAXecute('FILENAME.EXE') command, MAXterm will do this:
  576.      (a) Write a MAXINFO.DEF drop file in the \SESSION\ subdirectory.
  577.      (b) Close the comport while leaving the DTR hot.
  578.      (c) Shut down the graphics mode (ie: RestoreCrtMode;).
  579.      (d) Change to MAXterm's \SESSION\ subdirectory.
  580.      (e) Execute FILENAME.EXE with MAXterm's home directory as ParamStr(1).
  581.      (f) Change back to the MAXterm home directory.
  582.      (g) Restart the graphics mode (ie: SetGraphMode(GetGraphMode);).
  583.      (h) Restore the previous SVGA screen.
  584.      (i) Re-open the comport.
  585.      (j) Send an ASCII #13 to the comport indicating a successful return.
  586.  
  587.   3. While the MAXecutable is running, you have 100% control over everything,
  588.      MAXterm is no longer active in any way whatsoever. So it is completely up
  589.      to you to monitor for carrier, inactivity timeouts, etc. This also means
  590.      that you can now do things that are impossible within the constraints of
  591.      the MAXscript/MAXcontrol/MAXcolor language. You could theoretically run a
  592.      program of any other graphics resolution, the TDK and UltraBGI kits are
  593.      by no means required for MAXecutables.
  594.  
  595.   Technically, a MAXecutable is simply a remote operated door. It's not rocket
  596.   science, it's simply a way of giving door programmers unlimited possibilities
  597.   and total freedom of program design. When writing MAXecutable programs, you
  598.   need to look at things kind of backwards. The remote system actually becomes
  599.   the host in a sense. Just like any standard ANSI terminal, MAXterm doesn't
  600.   know anything about how much time a use has left. So you will need to make
  601.   some type of a "Server" program that runs as a door off of the BBS. This may
  602.   be needed to transfer the actual MAXecutable from the BBS to the remote, and
  603.   absolutely will be required to get any information about the user from the
  604.   BBS to the remote. There are no standardized commands or methods to do this,
  605.   so the server is an absolute must. The server may also be needed to send and
  606.   receive score data files or other critical system related files.
  607.  
  608.  
  609.   The MAXINFO.DEF Drop File:
  610.   ──────────────────────────
  611.   When a BBS or a door send the MAXecute command to your terminal program, it
  612.   will create a special drop file for the MAXecutable program to read...Below
  613.   is a line by line definition of the MAXINFO.DEF system drop file:
  614.  
  615.   1.  The user's name stored in the current dialing directory entry.
  616.   2.  The user's password stored in the current dialing directory entry.
  617.   3.  Use SoundBlaster: "TRUE" or "FALSE" (without quotes).
  618.   4.  Current .PKG file name in use with no .PKG extension.
  619.   5.  Program upload path.
  620.   6.  Program download path.
  621.   7.  System archiver path.
  622.   8.  System default archiver (1=ZIP, 2=LHA, 3=ARJ, 4=RAR, 5=Custom).
  623.   9.  Custom archiver batch file name.
  624.   10. Custom unarchiver batch file name.
  625.   11. Custom external protocol upload batch file name.
  626.   12. Custom external protocol download batch file name.
  627.   13. Current comport in use (1 to 8).
  628.   14. Current comport hex address (0 for standard address).
  629.   15. Current comport IRQ (0 for standard IRQ).
  630.   16. Current comm device (1=UART, 2=Fossil, 3=DigiBoard).
  631.   17. Current comport port speed (ie: locked port rate).
  632.   18. Current connection speed (ie: caller's actual baud rate).
  633.   19. Current comport input buffer size in bytes.
  634.   20. Current comport output buffer size in bytes.
  635.   21. Using hardware flow control: "TRUE" or "FALSE" (without quotes).
  636.   22. Modem initialization string #1.
  637.   22. Modem initialization string #2.
  638.   22. Modem initialization string #3.
  639.   23. Modem answer string.
  640.   24. Modem on hook string.
  641.   25. Modem off hook string.
  642.   26. Modem dialing string.
  643.  
  644.   NOTE: MAXterm only uses 8-N-1 communications....If I was interested in any
  645.         kind of 7 bit communications stuff or any internet programming, this
  646.         archive would say that is was from "Internet Utiliteez Software"....
  647.  
  648. ───────────────────────────────────────────────────────────────────────────────
  649.  
  650.       ┌───────────────────────────────────────────────────────────────────┐
  651.       │                                                                   │
  652.       │  ┌──      ┌──────           ┌──────   ┌──────  ┌────── ┌────────  │
  653.       │  ┌──     ┌──   ┌──         ┌──       ┌──   ┌── ┌──        ┌──     │
  654.       │  ┌──     ┌────────  ┌────   ┌──────  ┌──   ┌── ┌────      ┌──     │
  655.       │  ┌──     ┌──   ┌──               ┌── ┌──   ┌── ┌──        ┌──     │
  656.       │  ┌────── ┌──   ┌──          ┌──────   ┌──────  ┌──        ┌──     │
  657.       │                                                                   │
  658.       └───────────────────────────────────────────────────────────────────┘
  659.  
  660.                 Not just software....It's a computer enhancement!
  661.  
  662.       ┌───────────────────────────────────────────────────────────────────┐
  663.       │ Contact: 1:14/703@FidoNet             Or: USA MAX Graphics HQ-BBS │
  664.       │          411:1500/0@ivNET                 (308)762-2239           │
  665.       │          121:101/2@AllianceNet            FAX or Data Calls       │
  666.       │          maxgfx@juno.com                  ANSI/ASCII/MAX (No RIP) │
  667.       └───────────────────────────────────────────────────────────────────┘
  668.  
  669. ───────────────────────────────────────────────────────────────────────────────
  670.